Skip to content

fix(on-demand-sandboxes): ACR classic-builder fixes + cross-platform (Windows) azd hooks#338

Open
greenie-msft wants to merge 10 commits into
Azure-Samples:mainfrom
greenie-msft:fix/ondemand-sandboxes-acr-build-windows-hooks
Open

fix(on-demand-sandboxes): ACR classic-builder fixes + cross-platform (Windows) azd hooks#338
greenie-msft wants to merge 10 commits into
Azure-Samples:mainfrom
greenie-msft:fix/ondemand-sandboxes-acr-build-windows-hooks

Conversation

@greenie-msft

Copy link
Copy Markdown
Collaborator

Summary

Follow-up fixes for the on-demand-sandboxes preview sample so azd up/azd deploy works reliably and on Windows.

Build fixes (.NET)

  • Remove redundant FROM --platform=$TARGETPLATFORM from the .NET Containerfiles. The ACR Tasks classic builder (used by az acr build) doesn't support that BuildKit syntax; --platform linux/amd64 on the build command already sets the platform.
  • Pass --build-arg TARGETARCH=amd64 in dotnet/scripts/acr-build.sh because the classic builder doesn't auto-populate the BuildKit TARGETARCH arg (the runtime-identifier case needs it).

Cross-platform azd hooks

  • Add Windows PowerShell ports of the build and identity-attach scripts (acr-build.ps1, attach-scheduler-identity.ps1) for both the dotnet and python samples.
  • Convert azure.yaml predeploy/postprovision hooks to per-OS form (posix: sh, windows: pwsh) so azd selects the right script automatically.

Also included (prior unmerged commits on this branch)

This branch also carries earlier on-demand-sandboxes follow-up commits that hadn't landed in main yet (docs restructure, supported-region notes, AKS version fix, python VNet/model cleanup, azd hook shell sh).

Validation

  • .NET: full azd deploy ran the predeploy hook, built & pushed both images to ACR, and the mainapp pod reached 1/1 Running; an orchestration completed end-to-end.
  • Python: both container images build cleanly via local Docker.

Notes

  • The .ps1 scripts were authored but not yet executed on Windows (no pwsh on the dev machine) — logic mirrors the verified .sh scripts.

Nick Greenfield and others added 10 commits June 18, 2026 11:29
…ach, drop sample VNet

- Move scheduler-identity, worker-profile reference, and dashboard-logs
  content from the overview README into the per-language guides
- Merge "Choose your language" into "Get started"; point access to
  dts-team@microsoft.com
- Switch identity attach to the `az durabletask scheduler identity assign`
  CLI extension command (additive/merge-safe) in both guides and the
  attach-scheduler-identity.sh hooks
- Remove em dashes from all sandbox docs and sample READMEs
- .NET sample: drop the unnecessary VNet (AKS auto-provisions a managed
  VNet), fix gpt-4o -> gpt-5.1 references, and wire AZURE_OPENAI_LOCATION
  in main.parameters.json

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…, wire OpenAI location

Mirror the .NET sample cleanup in the Python sample:
- Remove the VNet module (AKS auto-provisions a managed VNet) and delete
  the unused vnet.bicep
- Fix stale gpt-4o references to gpt-5.1 to match the infra default
- Wire AZURE_OPENAI_LOCATION in main.parameters.json (defaults to eastus)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…default version

AKS 1.32 moved to Long-Term Support only, so pinning it fails preflight
validation on non-Premium clusters with K8sVersionNotSupported. Default
kubernetesVersion to empty in both samples and omit the property when
unset so AKS provisions its current default supported version.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
List the supported preview regions (East US 2, West US 3, North Europe,
Australia East, South Africa North) in the overview "Get private preview
access" section, reference them from Get started, and note the region
requirement in both sample READMEs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ipts POSIX

azd only supports sh/pwsh/python/js/ts for hook shells; 'bash' fails with
"kind is not supported". Switch the predeploy/postprovision hooks to
shell: sh in both samples and drop the non-POSIX 'pipefail' option from the
hook scripts so they run under a POSIX sh.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
durabletask-azuremanaged==1.6.0 already depends on durabletask>=1.6.0, so
pip resolves the core SDK transitively. Remove the explicit durabletask==1.6.0
from the guide, sample requirements.txt, Containerfiles, and the sample README.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… add Windows hooks

- Remove redundant FROM --platform=$TARGETPLATFORM from .NET Containerfiles (ACR classic builder doesn't support it; --platform on az acr build already sets it)
- Pass --build-arg TARGETARCH=amd64 in dotnet acr-build.sh (classic builder doesn't auto-populate BuildKit TARGETARCH)
- Add Windows PowerShell ports of acr-build and attach-scheduler-identity scripts for dotnet and python
- Convert azure.yaml predeploy/postprovision hooks to per-OS (posix: sh, windows: pwsh)
The main-app scheduled a single orchestration then exited. Deployed as a
Deployment, Kubernetes restarted the pod on every exit and re-scheduled a new
orchestration each time. Idle after the single run instead of exiting so the pod
stays Running:
- .NET: await host.WaitForShutdownAsync() instead of StopAsync()+return
- Python: idle loop inside the worker context until SIGTERM/Ctrl+C
…ll guidance

- Label the top prerequisites as local development and the azd ones as Azure deployment
- Replace contradictory 'enable anonymous pull' steps with granting the image-pull
  managed identity AcrPull (matches the code's required DTS_SANDBOX_IMAGE_PULL_UMI_CLIENT_ID
  and the bicep, which sets anonymousPullEnabled=false)
- Refresh example chat models (GPT-5.1/5/4.1); add Azure CLI + the two UMIs to .NET prereqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant